home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Revista CD Expert 8
/
Revista CD Expert nº 08 CD1.iso
/
Utilitarios
/
Programacao
/
Pacific C for DOS
/
INCLUDE
/
ASSERT.H
next >
Wrap
C/C++ Source or Header
|
1995-03-08
|
528b
|
21 lines
/*
* Assertion - use liberally for debugging. Defining NDEBUG
* turns assertions off.
* assert(exp) where exp is non-zero does nothing, while
* assert(exp) where exp evaluates to zero aborts the program
* with a message like
*
* Assertion failed: prog.c line 123: "exp"
*
*/
#ifndef NDEBUG
#ifndef __mkstr__
#define __mkstr__(exp) #exp
#endif
extern void _fassert(int, char *, char *);
#define assert(exp) if(!(exp)) {_fassert(__LINE__, __FILE__, __mkstr__(exp));}
#else
#define assert(exp)
#endif